sepolicy: Fix regressions from introduction of sepolicy_new_at()
authorColin Walters <walters@verbum.org>
Thu, 30 Mar 2017 17:38:08 +0000 (13:38 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 30 Mar 2017 19:49:46 +0000 (19:49 +0000)
commit8d4dec1b531f8cb6080887362a897f78c13fd098
tree22d2a2f71cafe17f6ff21e234d70576bcbfaf06d
parent305db981d47e4aa417dd90164b1995e008d25757
sepolicy: Fix regressions from introduction of sepolicy_new_at()

Being bitten by lack of PR testing here.  There are two bugs:

- First and foremost, I forgot that GObject will call the property setters with
  the defaults.  This meant we were getting both path="/var/tmp/blah" and fd=-1,
  and we were accepting -1 as a fd, which then got converted into AT_FDCWD
  which was wrong.
- Since these properties are construct only and mutually exclusive, don't
  try to handle one resetting the other.  Assert that exactly one of them is set.

Closes: #769
Approved by: jlebon
src/libostree/ostree-sepolicy.c